package com.xbongbong.paas.service;

import com.xbongbong.paas.pojo.ExportStatusPojo;
import com.xbongbong.paas.pojo.dto.ExcelExplainGetDTO;
import com.xbongbong.paas.pojo.dto.ExcelTemplateDTO;
import com.xbongbong.paas.pojo.dto.FormDataListDTO;
import com.xbongbong.paas.pojo.dto.ImportFormDataDTO;
import com.xbongbong.paas.pojo.vo.*;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.UserVO;
import com.xbongbong.pro.paymenttask.pojo.dto.PaymentTaskExportDTO;
import com.xbongbong.pro.webexport.dto.CommunicatePlanExportDTO;
import com.xbongbong.pro.webexport.dto.CustomerStatementExportDTO;
import com.xbongbong.pro.webexport.dto.SignInExportDTO;
import com.xbongbong.pro.webexport.dto.WorkReportExportDTO;
import com.xbongbong.pro.weblist.pojo.dto.NearCustomerDTO;
import org.apache.poi.ss.usermodel.Workbook;

import java.io.IOException;

/**
 * 导入导出Service层
 * 对应几个相关的接口
 *
 * @author wufeng
 * @date 2018/9/21 14:45
 */
public interface PaasExcelService {

    /**
     * Excel模板下载
     *
     * @param excelTemplateDTO 模板下载参数
     * @return ExcelTemplateVO
     * @throws XbbException XbbException
     */
    ExcelTemplateVO templateDownLoad(ExcelTemplateDTO excelTemplateDTO) throws XbbException;

    /**
     * 导入数据
     *
     * @param importFormDataDTO 导入数据参数
     * @return ImportFormDataVO
     * @throws XbbException XbbException
     */
    ImportFormDataVO importFormData(ImportFormDataDTO importFormDataDTO) throws XbbException, IOException;

    /**
     * 导入覆盖数据
     *
     * @param importFormDataDTO 导入数据参数
     * @return ImportFormDataVO
     * @throws XbbException XbbException
     */
    ImportFormDataVO coverFormData(ImportFormDataDTO importFormDataDTO) throws XbbException;

    /**
     * 导入无签订人数据
     *
     * @param importFormDataDTO 导入数据参数
     * @return ImportFormDataVO
     * @throws XbbException XbbException
     */
    ImportFormDataVO importNoSignFormData(ImportFormDataDTO importFormDataDTO) throws XbbException;
    /**
     * 导出数据
     *
     * @param formDataListDTO 导出列表查询参数
     * @return ExportFormDataVO
     * @throws XbbException XbbException
     * @author GuoJun.HU
     * @date 2019/5/7 14:12
     * @since V1.0
     */
    ExportFormDataVO exportFormData(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * 导出PaaS数据
     *
     * @param formDataListDTO 导出数据参数
     * @return ExportFormDataVO
     * @throws XbbException XbbException
     */
    ExportFormDataVO exportPaasFormData(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * 错误或重复excel下载
     *
     * @param excelTemplateDTO 下载参数
     * @return Workbook excel
     * @throws XbbException XbbException
     */
    Workbook errorOrUpdateDownLoad(ExcelTemplateDTO excelTemplateDTO) throws XbbException;

    /**
     * 获取导入excel状态
     *
     * @param baseDTO 入参
     * @return ImportStatusPojo
     * @throws XbbException XbbException
     */
    ImportStatusVO getImportStatus(BaseDTO baseDTO) throws XbbException;

    /**
     * 获取导出excel状态
     *
     * @param baseDTO 入参
     * @return ImportStatusPojo
     * @throws XbbException XbbException
     */
    ExportStatusPojo getExportStatus(BaseDTO baseDTO) throws XbbException;

    /**
     * 清除导入excel状态
     *
     * @param baseDTO 入参
     * @return boolean 是否成功
     * @throws XbbException XbbException
     */
    boolean delImportStatus(BaseDTO baseDTO) throws XbbException;

    /**
     * 清除导出excel状态
     *
     * @param baseDTO 入参
     * @return boolean 是否成功
     * @throws XbbException XbbException
     */
    boolean delExportStatus(BaseDTO baseDTO) throws XbbException;

    /**
     * 导出附近客户
     *
     * @param nearCustomerDTO 入参
     * @return 附近客户excel
     * @throws XbbException 异常
     */
    ExportFormDataVO exportNearCustomerFormData(NearCustomerDTO nearCustomerDTO) throws XbbException;

    /**
     * 导出访客计划
     *
     * @param communicatePlanExportDTO 入参
     * @return 访客计划excel
     * @throws XbbException 异常
     */
    ExportFormDataVO exportCommunicatePlanData(CommunicatePlanExportDTO communicatePlanExportDTO) throws XbbException;

    /**
     * 导出签到数据
     *
     * @param signInExportDTO 入参
     * @return 签excel
     * @throws XbbException 异常
     */
    ExportFormDataVO exportSignInData(SignInExportDTO signInExportDTO) throws XbbException;

    /**
     * 导出客户对账单数据
     * @param customerStatementExportDTO 入参
     * @return com.xbongbong.paas.pojo.vo.ExportFormDataVO
     * @throws XbbException
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    ExportFormDataVO exportCustomerStatementData(CustomerStatementExportDTO customerStatementExportDTO) throws XbbException;

    /**
     * Description: 导出工单列表
     * @param formDataListDTO
     * @return ExportFormDataVO
     * @throws XbbException XbbException
     * @author 刘阳
     * @date 2019/6/6 4:25 PM
     * @since v1.0
     */
    ExportFormDataVO exportWorkOrderData(FormDataListDTO formDataListDTO) throws XbbException;

    /**
     * 导出工作报告
     *
     * @param workReportExportDTO 入参
     * @return 报告excel
     * @throws XbbException 异常
     */
    ExportFormDataVO exportWorkReportData(WorkReportExportDTO workReportExportDTO) throws XbbException;

    /**
     * 导入接口网管端过滤导致没有透传UserVO
     * 外部调用获取UserVO
     *
     * @param corpid    公司id
     * @param userId    用户id
     * @author GuoJun.HU
     * @since V1.0
     * @throws XbbException XbbException
     * @return UserVO
     * @date 2019/6/11 17:16
     */
    UserVO getUserVo(String corpid, String userId) throws XbbException;

    /**
     * 自定义导出获取解释
     * @param excelExplainGetDTO
     * @return
     */
    ExportPartialExplainVO getExplainList(ExcelExplainGetDTO excelExplainGetDTO) throws XbbException;

    /**
     * 访客计划导出，根据条件筛选，获取总数
     *
     * @param communicatePlanExportDTO 入参
     * @return 访客计划excel
     * @throws XbbException 异常
     */
    ExportCommunicateCountVO getExportCommunicatePlanCount(CommunicatePlanExportDTO communicatePlanExportDTO) throws XbbException;

    ImportAttrsVO getAttrs(ExcelTemplateDTO excelTemplateDTO) throws XbbException;
    /**
     * 导出回款计划
     *
     * @param paymentTaskExportDTO
     * @return
     */
    ExportFormDataVO exportPaymentTaskData(PaymentTaskExportDTO paymentTaskExportDTO) throws XbbException;
}
